<template>
  <el-dialog v-model="dialogVisible" :close-on-click-modal="false" title="成本弹窗" width="1200" :before-close="handleClose">
    <template #default>
      <!-- 表格主体 -->
      <div class="card table-main">
        <el-table :data="tableData" style="width: 100%">
          <el-table-column property="project" label="项目名称" />
        <el-table-column property="site" label="站点" />
        <el-table-column property="count" label="计数" />
        </el-table>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
import { summariesInfoApi} from "@/api/modules/daily";

// 是否打开
const dialogVisible = ref(false)

onMounted(() => {

});
let tableData = ref()
const getTableList = () => {
  summariesInfoApi(id.value).then((res:any) => {
    tableData.value = res.costs
  })
};
const id = ref()
const open = (data) => {
  console.log('data',data.type);
  id.value = data.id
  dialogVisible.value = true
  getTableList();
}

const emit = defineEmits();
// 关闭前操作
const handleClose = (done: () => void) => {
  done()
}
// 暴露给父组件方法
defineExpose({
  open
});
</script>